package com.tomatozq163.structure;

public class Student {
    private String name;
    private int score;

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public int getScore() {
        return score;
    }

    @Override
    public String toString() {
        return String.format("Student(name:%s,score:%d)",name,score);
    }

    @Override
    public boolean equals(Object obj) {
        Student stu = (Student)obj;
        return stu.getScore() == this.score;
    }

    public static void main(String[] args){
        Array<Student> arr = new Array<>();

        arr.addLast(new Student("Alice",100));
        arr.addLast(new Student("Bob",78));
        arr.addLast(new Student("CharLie",60));

        System.out.println(arr);
    }
}
